<template>
	<div class="form-control">
		<el-form :model="group" label-width="auto">
			<el-form-item label="组名称">
				<el-input
					 v-model="group.name"
					 type="text"
					 placeholder="请输入人员组名称"
				  />
			</el-form-item>
		</el-form>
	</div>
</template>

<script>
export default {
	data(){
		return {
			group: {
				name: null,
			}
		}
	},
  created() {
    window.$bus.on('add-group',this.saveGurop);
  },
  methods:{
    saveGurop(index){
      if (this.group.name === ""){
        this.$layer.msg("组名不能为空")
        return false;
      }

      this.$api.saveGurop(this.group).then(ret => {
        parent.$bus.emit('close-win', index);
      })

    }
  }
}
</script>

<style scoped>
.form-control {
	padding: 30px 30px 10px;
}
</style>